<template>
  <div class="ma-content-block lg:flex justify-between p-4">
    <!-- CRUD 组件 -->
    <ma-crud :options="options" :columns="columns" ref="crudRef">
    </ma-crud>
  </div>
</template>
<script setup>
import { ref, reactive } from 'vue'
import lzccTransitCompany from '@/api/lzcc/lzccTransitCompany'
import { Message } from '@arco-design/web-vue'
import tool from '@/utils/tool'
import * as common from '@/utils/common'

const crudRef = ref()




const options = reactive({
  id: 'flyos_lzcc_transit_company',
  rowSelection: {
    showCheckedAll: true
  },
  pk: 'id',
  operationColumn: true,
  operationWidth: 160,
  formOption: {
    viewType: 'modal',
    width: 600
  },
  api: lzccTransitCompany.getList,
  add: {
    show: true,
    api: lzccTransitCompany.save,
    auth: ['lzcc:transitCompany:save']
  },
  edit: {
    show: true,
    api: lzccTransitCompany.update,
    auth: ['lzcc:transitCompany:update']
  },
  delete: {
    show: true,
    api: lzccTransitCompany.deletes,
    auth: ['lzcc:transitCompany:delete']
  },
  import: {
    show: true,
    url: 'lzcc/transitCompany/import',
    templateUrl: 'lzcc/transitCompany/downloadTemplate',
    auth: ['lzcc:transitCompany:import']
  },
  export: {
    show: true,
    url: 'lzcc/transitCompany/export',
    auth: ['lzcc:transitCompany:export']
  }
})

const columns = reactive([
  {
    title: "ID",
    dataIndex: "id",
    formType: "input",
    addDisplay: false,
    editDisplay: false
  },
  {
    title: "公司名称",
    dataIndex: "name",
    formType: "input",
    search: true,
    commonRules: {
      required: true,
      message: "请输入公司名称"
    }
  },
  {
    title: "创建时间",
    dataIndex: "created_at",
    formType: "date",
    addDisplay: false,
    editDisplay: false,
    sortable: {
      sortDirections: [
        "ascend",
        "descend"
      ],
      sorter: true
    },
    showTime: true
  },
  {
    title: "更新时间",
    dataIndex: "updated_at",
    formType: "date",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    showTime: true
  },
  {
    title: "删除时间",
    dataIndex: "deleted_at",
    formType: "date",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    showTime: true
  },
  {
    title: "创建者",
    dataIndex: "created_by",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true
  },
  {
    title: "更新者",
    dataIndex: "updated_by",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true
  }
])
</script>
<script> export default { name: 'lzcc:transitCompany' } </script>